package cn.topevery.garden.dal.logic;

import cn.topevery.garden.dal.dao.ParkComponentDao;
import cn.topevery.garden.entity.fetch.ParkComponentFetch;
import cn.topevery.garden.entity.po.ParkComponent;
import cn.topevery.garden.entity.query.ParkComponentQuery;
import cn.topevery.garden.entity.vo.ParkComponentVO;
import cn.topevery.garden.framework.base.BaseLogic;
import hw.topevery.framework.db.base.BaseEntityDao;
import hw.topevery.framework.db.entity.DataPager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 
 *
 * @author code-generate
 * @date 2022-01-05
 */
@Service
public class ParkComponentLogic extends BaseLogic<ParkComponent> {
    @Autowired
    ParkComponentDao parkComponentDao;

    @Override
    public BaseEntityDao<ParkComponent, Integer> getDao() {
        return parkComponentDao;
    }

    

    /**
     * 获取列表
     *
     * @param query
     */
    public DataPager<ParkComponentVO> listPage(ParkComponentQuery query) {
        return parkComponentDao.listPage(query);
    }

    /**
     * 根据自增id批量删除
     *
     * @param ids
     */
    public void deleteBatchById(String userId,Integer[] ids) {
        parkComponentDao.delete(userId, ids);
    }

    /**
     * 根据自增id保存或者更新
     *
     * @param parkComponent 实体
     */
    public void saveOrUpdate(String userId, ParkComponent parkComponent){
        parkComponentDao.saveOrUpdate(userId,parkComponent);
    }

    /**
         * 根据自定义列值来获取对象
         */
    public ParkComponent getEntityByColumn(String key, String value) {
        return parkComponentDao.getEntityByColumn(key, value);
    }


    public  List<Map<String, Object>> getComponentTypeList(){
        return parkComponentDao.getComponentTypeList();
    }

    public DataPager<ParkComponent> queryParkComponentPage(ParkComponentFetch parkComponentFetch) {
        return parkComponentDao.queryParkComponentPage(parkComponentFetch);
    }
}
